package com.vvvtimes.demo.controller;

import com.vvvtimes.demo.common.dto.RestResponse;
import com.vvvtimes.demo.domain.dto.EncoderDTO;
import com.vvvtimes.demo.service.ConvertService;
import com.vvvtimes.demo.service.EncoderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.InputStreamResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.io.ByteArrayInputStream;

@RestController
@RequestMapping("/convert")
public class ConvertController {

    @Autowired
    private ConvertService convertService;

    @RequestMapping(value = "/jsonToExcel", method = {RequestMethod.POST, RequestMethod.GET})
    public void jsonToExcel(@RequestBody String string) {
       convertService.jsonToExcel(string);
    }
}

